#ifndef __S_IPUS_64MBIT_H__
#define __S_IPUS_64MBIT_H__

typedef enum
{
    s_ipus_64Mb_ok = 0,
    s_ipus_64Mb_struct_null,
    s_ipus_64Mb_cs_enable_null,
    s_ipus_64Mb_cs_disable_null,
    s_ipus_64Mb_write_null,
    s_ipus_64Mb_read_null,
    s_ipus_64Mb_delay_us_null,
}s_ipus_64Mb_state;

typedef struct
{
    void (*spi_cs_enable)(void);
    void (*spi_cs_disable)(void);
    void (*spi_write)(unsigned char *data, unsigned short len);
    void (*spi_read)(unsigned char *data, unsigned short len);
    void (*delay_us)(unsigned int time);
}s_ipus_64Mb_t;

extern s_ipus_64Mb_state s_ipus_64Mb_reset(s_ipus_64Mb_t *ipus_t);
extern s_ipus_64Mb_state s_ipus_64Mb_readID(s_ipus_64Mb_t *ipus_t, unsigned short *ids);
extern s_ipus_64Mb_state s_ipus_64Mb_read(s_ipus_64Mb_t *ipus_t, unsigned int address, unsigned char *data, unsigned short len);
extern s_ipus_64Mb_state s_ipus_64Mb_write(s_ipus_64Mb_t *ipus_t, unsigned int address, const unsigned char *data, unsigned short len);

#endif
